<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<script type="text/javascript" src="./build/react.js"></script>
	<script type="text/javascript" src="./build/react-dom.js"></script>
	<script type="text/javascript" src="./build/browser.min.js"></script>
	<title>React Simple Application</title>
</head>
<body>
	<div id="example"></div>
	<script type="text/babel">
		var ShowEditor = React.createClass(
			{
				getInitialState:function(){
					return {value:'您可以在这里输入文字'};
				},

				handleChange:function(){
					this.setState({value:this.refs.myTextarea.value});
				},

				render:function(){
					return (
						                        <div>
						                        <h3>输入</h3>
						                                <textarea style={{width:300,height:150,outline:'none'}}
						                   onChange={this.handleChange}
						                   ref="myTextarea"
						                defaultValue={this.state.value}

						            />
						<h3>输出</h3>

						        <div> {this.state.value} </div>

						                        </div>
					);
				}
			}
		);

		ReactDOM.render(<ShowEditor />, document.getElementById('example'));
	</script>
</body>
</html>